<script>
export default {
  globalData: {
    userInfo: null,
    session_token: null,
    apiBase: 'https://ws.waterism.tech:8090',
    basinCode: '21100150' // 测试流域 ID
  },
  
  onLaunch() {
    console.log('小程序启动');
    
    // 检查是否有缓存的 token
    const token = uni.getStorageSync('session_token');
    if (token) {
      this.globalData.session_token = token;
      console.log('发现缓存的 token');
    }
  },
  
  onShow() {
    console.log('小程序显示');
  },
  
  onHide() {
    console.log('小程序隐藏');
  }
}
</script>

<style>
/* 全局样式 */
page {
  background: #f5f6f7;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.container {
  padding: 32rpx;
}

.card {
  background: #ffffff;
  border-radius: 16rpx;
  padding: 32rpx;
  margin-bottom: 24rpx;
  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
}

.title {
  font-size: 32rpx;
  font-weight: 600;
  color: #333333;
  margin-bottom: 16rpx;
}

.subtitle {
  font-size: 28rpx;
  font-weight: 500;
  color: #666666;
  margin-bottom: 12rpx;
}

.text {
  font-size: 28rpx;
  color: #666666;
  line-height: 1.6;
}

.button-primary {
  background: #07c160;
  color: #ffffff;
  border-radius: 8rpx;
  padding: 24rpx;
  text-align: center;
  font-size: 32rpx;
  font-weight: 500;
}

.button-secondary {
  background: #ffffff;
  color: #07c160;
  border: 2rpx solid #07c160;
  border-radius: 8rpx;
  padding: 24rpx;
  text-align: center;
  font-size: 32rpx;
  font-weight: 500;
}

.status-success {
  color: #07c160;
}

.status-warning {
  color: #ff9500;
}

.status-error {
  color: #ff3b30;
}

.status-info {
  color: #999999;
}
</style>
